import request from '@/utils/request'

//获取分类1列表
export function getCategory1() {
    return request({ url: `/product/getCategory1`, method: 'get' })
}

//根据分类1id获取分类2列表
export function getCategory2By1Id(category1Id) {
    return request({ url: `/product/getCategory2/${category1Id}`, method: "get" })
}

//根据分类2id获取分类3列表
export function getCategory3By2Id(category2Id) {
    return request({ url: `/product/getCategory3/${category2Id}`, method: "get" })
}

//查询相关商品
export const getCategoryList = ({ category1Id, category2Id, category3Id }) => request({ url: `/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}` })

//添加品牌属性
export const saveAttr = (data) => request({ url: `/product/saveAttrInfo`, method: 'post', data })

//品牌删除
export const delAttrById = (attrId) => request({ url: `/product/getAttrValueList/${attrId}`, method: 'get' })